<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>lhgdialog组件演示</title>
	<script type="text/javascript" src="../../js/lhgdialog/lhgcore.min.js"></script>
	<script type="text/javascript">
var DG = frameElement.lhgDG;

J(function(){
    J('#btn1').bind( 'click', function(){
        // child是子窗口的id 
		if( DG.iDG('child') )
		    alert( DG.iDoc('child').getElementById('inpB').value );
			// 也可以使用jQ方式来写
			// alert( J('#inpB',DG.iDoc('child')).val() );
		else
		    alert( '请先打开子窗口' );
	});
	
	J('#btn2').bind( 'click', function(){
	    if( DG.iDG('child') )
		    DG.iWin('child').fnB();
		else
		    alert( '请先打开子窗口' );
	});
});

function fnA()
{
    alert( '我是父窗口的函数' );
}

function opchild()
{
    var childDG = new DG.curWin.J.dialog({ id:'child', title:'子窗口', page:'demo-page/valueDemo/content12.html', parent:DG });
	childDG.ShowDialog();
}
	</script>
</head>

<body>

    <h3 style="font-size:14px;padding:50px 0;text-align:center;">
	    <input type="button" id="btn0" value="打开子窗口" onclick="opchild();"/><br/>
		<input type="type" id="inpA" value="我是父窗口的文本框的值"/><br/>
		<input type="button" id="btn1" value="调用子窗口文本框的值"/><br/>
		<input type="button" id="btn2" value="调用子窗口页面的函数"/>
	</h3>
</body>
</html>